# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=kio-extras
pkgver=24.02.2
pkgrel=0
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://www.kde.org/applications/internet/"
pkgdesc="Additional components to increase the functionality of KIO"
license="GPL-2.0-or-later (LGPL-2.1-only OR LGPL-3.0-only)"
makedepends="
	extra-cmake-modules
	gperf
	karchive-dev
	kbookmarks-dev
	kcmutils-dev
	kconfig-dev
	kconfigwidgets-dev
	kcoreaddons-dev
	kdbusaddons-dev
	kdnssd-dev
	kdoctools-dev
	kdsoap-qt6-dev
	kdsoap-ws-discovery-client-dev
	kguiaddons-dev
	ki18n-dev
	kiconthemes-dev
	kio-dev
	kpty-dev
	kstatusnotifieritem-dev
	libkexiv2-dev
	libmtp-dev
	libssh-dev
	nfs-utils-dev
	phonon-dev
	plasma-activities-stats-dev
	qcoro-dev
	qt6-qtbase-dev
	qt6-qtsvg-dev
	samba-dev
	samurai
	shared-mime-info
	solid-dev
	syntax-highlighting-dev
	taglib-dev
	"
checkdepends="xvfb-run dbus"
subpackages="$pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/network/kio-extras.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kio-extras-$pkgver.tar.xz"

replaces="kio5"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	dbus-run-session -- xvfb-run ctest --test-dir build --output-on-failure \
		-E "testkioarchive|thumbnailtest|ActivityBasicTest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
2c4c807a8debe6ab4ae26208ca60ab3b3dff76d36edf686e77ebd644d6bc3f01ba40b903f9c3f8161421ea31764be339556fd832da29ede1b541432020fff890  kio-extras-24.02.2.tar.xz
"
